home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-13 / wwived23.zip / EDITINFO.MOD < prev    next >
Text File  |  1992-04-19  |  13KB  |  309 lines

  1. EDITINFO.MOD
  2. by Adam Caldwell (The Emporer)
  3.  
  4. ===========================================================================
  5. This is a mod that I made so that WWIVEdit 2.2 could ALWAYS get the correct
  6. title and destination when it loaded up.  It also has the side effect of
  7. allowing Title changes and "Result" codes for Anonymous/Non-Anonymous saves.
  8.  
  9.    ***** This version will only work with WWIVEdit 2.3 and above *****
  10. Requires WWIV 4.20 or 4.21.  If you have WWIV 4.12 still, get the EDITINFO.MOD
  11. from WWIVED22.ZIP.
  12.  
  13. 1/18/92 I finally update the mod for WWIV 4.20 (now it won't work with
  14. WWIV 4.12)
  15.  
  16. 4/3/92 Update for WWIV 4.21 (really no different) and added FEDIT
  17. compatibility and Delete key fix.
  18. ===========================================================================
  19. Step 1:
  20.  
  21. Back everything up... This should go without saying by now...
  22. ===========================================================================
  23. Step 2:
  24.  
  25. Load up VARS.H and make the following addition:
  26.  
  27. char ansistr[81], cdir[81], charbuffer[161], chatreason[81], crttype,
  28.      curspeed[81], dcd[81], dc[81], dszlog[81], endofline[81],
  29.      gatfn[81], irt[81], net_email_name[81], newprompt[161], odc[81],
  30.      search_pattern[81], ver_no1[51], xdate[9], irt_name[81];
  31.  
  32. char message_title[81], message_dest[81];         /* Add Me */
  33. int  in_fsed;                                     /* Add Me */
  34.  
  35. int abortext, already_on, ansiptr, arcling, async_irq, base, bchanged,
  36.     change_color, charbufferpointer, chatcall, chatting, chat_file,
  37.  
  38. =============================================================================
  39. Step 3:
  40.  
  41. Still in VARS.H, but further down, make this addition:
  42.  
  43. extern char ansistr[81], cdir[81], charbuffer[161], chatreason[81], crttype,
  44.      curspeed[81], dcd[81], dc[81], dszlog[81], endofline[81],
  45.      gatfn[81], irt[81], net_email_name[81], newprompt[161], odc[81],
  46.      search_pattern[81], ver_no1[51], xdate[9], irt_name[81];
  47.  
  48. extern char message_title[81], message_dest[81];         /* Add Me */
  49. extern int  in_fsed;                                     /* Add Me */
  50.  
  51. extern int abortext, already_on, ansiptr, arcling, async_irq, base, bchanged,
  52.     change_color, charbufferpointer, chatcall, chatting, chat_file,
  53.     checkit, configfile, curatr, curdir, curdloads, curldir, curlsub,
  54.  
  55.  
  56. ===========================================================================
  57. Step 4:
  58.  
  59. Save VARS.H and load up BBS.C.
  60. ===========================================================================
  61. Step 5:
  62.  
  63. In BBS.C, in void text_edit() add these two lines:
  64.  
  65.     sprintf(s1,"@ Edited: %s",s);
  66.     sysoplog(s1);
  67.     if (okfsed()) {                             /* Add { at end of line */
  68.       strcpy(message_title,s);                                /* Add Me */
  69.       strcpy(message_dest,syscfg.gfilesdir);                  /* Add Me */
  70.       external_edit(s,syscfg.gfilesdir,thisuser.defed-1,500);
  71.     } else                                     /* Add } at start of line*/
  72.       tedit(s);
  73. ===========================================================================
  74. Step 6:
  75.  
  76. Still in BBS.C in void mainmenu() add these two lines:
  77.   if ((strcmp(s,"EDIT")==0) && (so())) {
  78.     nl();
  79.     prt(2,"Filename? ");
  80.     input(s1,50);
  81.     if (s1[0]) {
  82.       if ((okansi()) && (thisuser.defed)) {         /* Add { at end of line */
  83.         strcpy(message_title,s1);                   /* Add Me */
  84.         strcpy(message_dest,"BBS Main Directory");  /* Add Me */
  85.         external_edit(s1,"",thisuser.defed-1,500);
  86.       } else                                        /* Add } in front */
  87.         tedit(s1);
  88. ===========================================================================
  89. Step 7:
  90.  
  91. Save BBS.C and load up MSGBASE.C
  92. ===========================================================================
  93. Step 8.A:
  94. /** This part is needed only if you HAVEN'T added the FEDIT mod in the     **/
  95. /** documentation to FEDIT.                              **/
  96. /** The following is a modified version of the FEDIT mod by One Eyed Willy **/
  97.  
  98. In MSGBASE.C, just above void inmsg() Add the following:
  99.  
  100. typedef struct     /* Add */
  101. {                  /* Add */
  102.     char tlen,     /* Add */
  103.     ttl[81],       /* Add */
  104.     anon;          /* Add */
  105. } infstruct;       /* Add */
  106.  
  107. Now add the following two lines (marked /*Add*/)
  108.   char s[LEN],s1[LEN],s2[LEN],ro[81],fnx[81],chx,*ss,*ss1,pseudo[25];
  109.   int maxli,curli,done,save,savel,i,i1,i2,i3,i4,i5,f,setanon,gati[50],gatp;
  110.   messagerec m;
  111.   long ll,l1;
  112.   char *lin, *b;
  113.   int real_name=0;
  114.   FILE *stream;          /* Add */
  115.   infstruct fedit_data;  /* Add */
  116.  
  117. Further down, Search for the following code:
  118.     pl("Aborted.");                              /* Existing Line */
  119.     m.stored_as=0xffffffff;                      /* Existing Line */
  120.     *m1=m;                                       /* Existing Line */
  121.     if (!fsed)                                   /* Existing Line */
  122.       farfree((void *)lin);                      /* Existing Line */
  123.     return;                                      /* Existing Line */
  124.   }                                              /* Existing Line */
  125.  
  126.   if (fsed) {                                         /* Add */
  127.     fedit_data.tlen=60;                               /* Add */
  128.     strcpy(fedit_data.ttl,title);                     /* Add */
  129.     fedit_data.anon=0;                                /* Add */
  130.     stream=fopen("FEDIT.INF","wb");                   /* Add */
  131.     fwrite(&fedit_data,sizeof(infstruct),1,stream);   /* Add */
  132.     fclose(stream);                                   /* Add */
  133.   }                                                   /* Add */
  134.  
  135.   if (!fsed) {                                           /* Existing Line */
  136.     sprintf(s,"Enter message now, max %u lines.",maxli); /* Existing Line */
  137.  
  138. Further Down,
  139.       if (save) {                      /* Existing Line */
  140.         pl("Reading in file...");                     /* Existing Line */
  141.       }                                               /* Existing Line */
  142.       use_workspace=0;                                /* Existing Line */
  143.     }                                                 /* Existing Line */
  144.   }
  145.  
  146.   if (fsed) {                                       /* Add */
  147.     stream=fopen("FEDIT.INF","rb");                 /* Add */
  148.     fread(&fedit_data,sizeof(infstruct),1,stream);  /* Add */
  149.     fclose(stream);                                 /* Add */
  150.     strcpy(title,fedit_data.ttl);            /* Add */
  151.     setanon=fedit_data.anon;                        /* Add */
  152.     unlink("FEDIT.INF");                            /* Add */
  153.   }                                                 /* Add */
  154.  
  155.   if (save) {                    /* Existing Line */
  156.     switch(*anony) {                            /* Existing Line */
  157.       case 0: /* no anony */                    /* Existing Line */
  158.     *anony=0;                               /* Existing Line */
  159.         break;
  160.  
  161.  
  162. Step 8.B: (This part is needed even if you do have the Fedit mod installed)
  163.   Go back up now and make the following addition:
  164.  
  165.   if (okansi()) {                /* Existing Line */
  166.     prt(2,"Title: ");                       /* Existing Line */
  167.     mpl(60);                                /* Existing Line */
  168.     inputl(title,60);                       /* Existing Line */
  169.     strcpy(message_title,title);       /* Add Me */
  170.   } else {                                  /* Existing Line */
  171.  
  172.  
  173. ===========================================================================
  174. Step 9:
  175.  
  176. In void email() about 100 lines further down... Add this line
  177.  
  178.     if (un==0)                                          /* Existing Line */
  179.       sprintf(s2,"%s @%u",net_email_name,sy);           /* Existing Line */
  180.     else                                                /* Existing Line */
  181.       sprintf(s2,"User %u @%u",un,sy);                  /* Existing Line */
  182.   }                                                     /* Existing Line */
  183.   npr("E-mailing %s\r\n",s2);                /* Existing Line */
  184.   strcpy(message_dest,s2);                  /* Add Me */
  185.   if (ss.ability & ability_email_anony)                 /* Existing Line */
  186.     i=anony_enable_anony;                               /* Existing Line */
  187.   else                                                  /* Existing Line */
  188.     i=0;                                                /* Existing Line */
  189.   if (anony & (anony_receiver_pp | anony_receiver_da))  /* Existing Line */
  190. ===========================================================================
  191. Step 10:
  192.  
  193. Save MSGBASE.C and load MSGBASE1.C
  194. ===========================================================================
  195. Step 11:
  196.  
  197. At the top just after the following lines:
  198. #define EMAIL_STORAGE 2 /* Existing line */
  199.  
  200. int deleted_flag;       /* Existing line */
  201.  
  202. Add all of these lines:
  203.  
  204. void create_editor_info()
  205. {
  206.   FILE *f;
  207.  
  208.   remove("EDITOR.INF");
  209.   remove("RESULT.ED");
  210.   if ((f=fopen("EDITOR.INF","wt"))!=NULL) {
  211.     fprintf(f,"%s\n%s\n%u\n%s\n%s\n%u\n",
  212.       message_title,
  213.       message_dest,
  214.       usernum,
  215.       thisuser.name,
  216.       thisuser.realname,
  217.       thisuser.sl);
  218.     fclose(f);
  219.   }
  220. }
  221. ===========================================================================
  222. Step 12:
  223.  
  224. In void post() add the following line:
  225.     if (syscfg.systemnumber) {                    /* Existing Line */
  226.       nl();                                       /* Existing Line */
  227.       pl("This post will go out on WWIVnet.");    /* Existing Line */
  228.       nl();                                       /* Existing Line */
  229.     }                                             /* Existing Line */
  230.   }                                               /* Existing Line */
  231.   strcpy(message_dest,subboards[curlsub].name);                  /* Add me */
  232.   inmsg(&m,p.title,&a,1,(subboards[curlsub].filename),ALLOW_FULLSCREEN); /* Existing Line */
  233.   if (m.stored_as!=0xffffffff) {                  /* Existing Line */
  234.     p.anony=a;                                    /* Existing Line */
  235. ===========================================================================
  236. Step 13:
  237.  
  238. In int external_edit() add this line:
  239.   itoa(numlines,sx3,10);                /* Existing Line */
  240.   stuff_in(s,s1,fn,sx1,sx2,sx3,"");     /* Existing Line */
  241.   in_fsed=1;                               /* Add Me */
  242.   create_editor_info();                                    /* Add Me */
  243.   full_external(s,0,1);                 /* Existing Line */
  244.   in_fsed=0;                                               /* Add Me */
  245.   if (!wfc)                             /* Existing Line */
  246.     topscreen();                        /* Existing Line */
  247. ===========================================================================
  248. Step 14:
  249.  
  250. Save MSGBASE1.C and Load MULTMAIL.C
  251. ===========================================================================
  252. Step 15:
  253.  
  254. In void multimail() add this line:
  255.   m.msg.storage_type=EMAIL_STORAGE;             /* Existing Line */
  256.   strcpy(irt,"Multi-Mail");                     /* Existing Line */
  257.   irt_name[0]=0;                                /* Existing Line */
  258.   strcpy(message_dest, irt);                                   /* Add Me */
  259.   inmsg(&m.msg,t,&i,1,"EMAIL",ALLOW_FULLSCREEN);/* Existing Line */
  260.   if (m.msg.stored_as==0xffffffff)              /* Existing Line */
  261.     return;                                     /* Existing Line */
  262.   strcpy(m.title,t);                            /* Existing Line */
  263. ===========================================================================
  264. Step 16:
  265.  
  266. Save MULTMAIL.C and load XINIT.C
  267. ===========================================================================
  268. Step 17:
  269.  
  270.   chat_file=0;                    /* Existing Line */
  271.   in_fsed=0;                            /* Add Me */
  272.   do_event=0;                                   /* Existing Line */
  273.   sysop_alert=0;                                /* Existing Line */
  274.  
  275. ===========================================================================
  276. Step 18:
  277.  
  278. Save XINIT.C and load COM.C
  279. ===========================================================================
  280.  
  281. In skey1() make the following change:
  282.   c = *ch;                /* Existing Line */
  283.   if (c == 127 && !in_fsed)     /* Add "&& !in_fsed" */
  284.     c = 8;                              /* Existing Line */
  285.   if (okskey)                           /* Existing Line */
  286.     switch(c) {                         /* Existing Line */
  287.       case 1:                           /* Existing Line */
  288.  
  289. ===========================================================================
  290.  
  291. Disclaimer:
  292.   I assume no responsibilty if this blows up your system.
  293.  
  294. About this mod:
  295.   This mod no longer will conflict with the FEdit mod as it has the Fedit
  296. mod incorporated into it.
  297.   This mod has been successfully used on my BBS with my 254 Message base
  298. installed, as well as some other mods.  If you have any problems with this
  299. mod, there are a bunch of ways that you can contact me:
  300.  
  301. 1) E-Mail me via WWIVLink as 1   @16470
  302. 2) E-Mail me via WWIVNet  as 1   @6470
  303. 3) E-Mail me via WWIVNet  as 718 @5252
  304. 4) E-Mail me via Internet as acaldwel@oucsace.ohiou.edu 
  305.    Note: I can not respond to UUCP mail, nor am I guaranteed to get it.
  306. 5) E-Mail me via Bitnet   as CS755@OUACCVMB
  307. 6) Call my BBS at 614-593-7836 [The First Galactic Empire]
  308. 7) Call me (only if you are *REALLY* desperate at 614-594-3051)
  309.